package seatiger.tomcat.catalina.core;

import seatiger.tomcat.catalina.Contained;
import seatiger.tomcat.catalina.Container;
import seatiger.tomcat.catalina.Valve;
import seatiger.tomcat.catalina.connector.NewRequest;
import seatiger.tomcat.catalina.connector.NewResponse;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Author 10896390
 * @Date 2024/4/23 19:07
 * @Version 1.0
 */
public abstract class ValveBase implements Valve, Contained {
    private Container container;

    protected Valve next;

    @Override
    public Container getContainer() {
        return container;
    }

    @Override
    public void setContainer(Container container) {
        this.container = container;
    }

    @Override
    public void setNext(Valve valve) {
        this.next = valve;
    }

    @Override
    public Valve getNext() {
        return next;
    }

    @Override
    public abstract void invoke(NewRequest request, NewResponse response) throws IOException, ServletException;
}
